
﻿﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/static/include/topLess.jsp"%>

<form name="myForm" method="POST" action="${baseURL}/unit/modify">
<input type="hidden" name="id" value="${unit.id}" />

<table id="listTable">
	<tbody>
		<tr>
			<th colspan="2"><img src="${ctx}/static/images/pages/cen/rig/ico_02.png" align="absmiddle">&nbsp;修改详情</th>
		</tr>
		<tr>
			<td class="tab_td_all" colspan="2">单位类型：
				<select id="roleId" name="roleId">
				   <option value="">请选择..</option>
				   <c:forEach var="role" items="${roleList}">
					   <option value="${role.id}" ${unit.role.id==role.id?'selected':''}>${role.roleName}</option>
				   </c:forEach>
			   </select>
			</td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">组织机构代码：
				<input name=unitInstitutionCode type="text" class="button" id="unitInstitutionCode"
					value="${obj.unitInstitutionCode}" size="30" />
			</td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">企业编号：
<input name=superCompanyCode type="text" class="button" id="superCompanyCode"
	value="${obj.superCompanyCode}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">单位名称：
<input name=unitName type="text" class="button" id="unitName"
	value="${obj.unitName}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">法定代表人：
<input name=fr type="text" class="button" id="fr"
	value="${obj.fr}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">行 业 类 别：
<select id="industryId" name="industryId">
				<option value="0">请选择...</option>
				<c:forEach var="item" items="${industryList}">
					<option value="${item.id}" ${unit.industryId==item.id?'selected':''}>${item.dustryName}</option>
				</c:forEach>
	</select></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">所在地行政区划：</td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">省(自治区、直辖市)：
	<select id="areaId_1" name="provinceId" onchange="getChildArea2($('#areaId_1').val());">
				<option value="0">请选择...</option>
				<c:forEach var="item" items="${provinceList}">
					<option value="${item.id}" ${areaMap.provinceId==item.id?'selected':''}>${item.areaName}</option>
				</c:forEach>
	</select></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">地(区、市、州、盟)：

	<select id="areaId_2" name="cityId" onchange="getChildArea3($('#areaId_2').val());">
			<option value="0">请选择...</option>
				<c:forEach var="item" items="${cityList}">
					<option value="${item.id}" ${areaMap.cityId==item.id?'selected':''}>${item.areaName}</option>
				</c:forEach>
						</select></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">县(区、市、旗)：

	<select id="areaId_3" name="townId" >
	<option value="0">请选择...</option>
				<c:forEach var="item" items="${townList}">
					<option value="${item.id}" ${areaMap.townId==item.id?'selected':''}>${item.areaName}</option>
				</c:forEach></select></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">乡(镇)：
<input name=larea type="text" class="button" id="larea"
	value="" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">村(居)：
<input name=lareaName type="text" class="button" id="lareaName"
	value="${obj.lareaName}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">企业性质：
<select id="unitProperId" name="unitProper">
				<option value="0">请选择...</option>
				<option value="1" ${unit.unitProper=="1"?'selected':''}>涉海企业</option>
				<option value="2" ${unit.unitProper=="2"?'selected':''}>用海企业</option>
				<option value="3" ${unit.unitProper=="3"?'selected':''}>开发区企业</option>
				<option value="1,2" ${unit.unitProper=="1,2"?'selected':''}>用海及涉海企业</option>				
	</select></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">单位地址：
<input name=addr type="text" class="button" id="addr"
	value="${obj.addr}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">联系电话：
<input name=tel type="text" class="button" id="tel"
	value="${obj.tel}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">企业网址：
<input name=mobile type="text" class="button" id="mobile"
	value="${obj.mobile}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">电子邮箱：
<input name=fax type="text" class="button" id="fax"
	value="${obj.fax}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">产品一：
<input name=product1 type="text" class="button" id="product1"
	value="${obj.product1}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">产品二：
<input name=product2 type="text" class="button" id="product2"
	value="${obj.product2}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">产品三：
<input name=product3 type="text" class="button" id="product3"
	value="${obj.product3}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">登记注册类型：
<input name=zclx type="text" class="button" id="zclx"
	value="${obj.zclx}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">国民经济代码：
<input name=lm type="text" class="button" id="lm"
	value="${obj.lm}" size="30" /></td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">用海企业坐标：经度：
<input name="kkx" type="text" class="button" id="jd"
	value="${obj.kkx}" size="10" />度
	<input name="kky" type="text" class="button" id="jd"
	value="${obj.kky}" size="10" />分
	<input name="kkz" type="text" class="button" id="jd"
	value="${obj.kkz}" size="10" />秒</td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">纬度：
<input name="dlx" type="text" class="button" id="wd"
	value="${obj.dlx}" size="10" />度
	<input name="dly" type="text" class="button" id="jd"
	value="${obj.dly}" size="10" />分
	<input name="dlz" type="text" class="button" id="jd"
	value="${obj.dlz}" size="10" />秒</td>
		</tr>
		
		<tr>
			<td class="tab_td_all" colspan="2">企业简介：
<input name=proInfo type="text" class="button" id="proInfo"
	value="${obj.proInfo}" size="30" /></td>
		</tr>
		<tr>
		<td class="tab_td_all" align="center" colspan="2">
	<input name="submit" type="submit" value="提交" class="tab_but"  />
	<input class="tab_but" type="button" value="关闭"
				onclick="closeWin();" /></td>


	
	</tbody>
</table>

</form>

<script>
if(${areaMap.flag=="1"}){
	$("#areaId_3").attr("name","areaId");
}else if(${areaMap.flag=="2"}){
	$("#areaId_2").attr("name","areaId");
}else{
	$("#areaId_1").attr("name","areaId");
}

//取得第一级区域
function getChildArea1(pid){
	 $.getJSON("${baseURL}/unit/getChildArea?pid=" +pid, function(data) {
		 	$("#areaId_1").empty();	
		 	$("#areaId_2").empty();
			$("#areaId_3").empty();
			
			$("#areaId_1").append( "<option value='0'>请选择..</option>" );
		 	$.each(data, function(i, item) {
	            $("#areaId_1").append( "<option value='" + item.id + "'>" + item.areaName + "</option>" );
	        });
	 });
}

//取得第二级区域
function getChildArea2(pid){
	if(pid=="0"){
		$("#areaId_2").empty();
		$("#areaId_3").empty();
		return;
	}
	 $.getJSON("${baseURL}/unit/getChildArea?pid=" +pid, function(data) {
			$("#areaId_2").empty();
			$("#areaId_3").empty();
			
			$("#areaId_2").append( "<option value='0'>请选择..</option>" );
		 	$.each(data, function(i, item) {
	            $("#areaId_2").append( "<option value='" + item.id + "'>" + item.areaName + "</option>" );
	        });
		 	
	 });
}

//取得第三级区域
function getChildArea3(pid){
	if(pid=="0"){
		$("#areaId_3").empty();
		return;
	}
	 $.getJSON("${baseURL}/unit/getChildArea?pid=" +pid, function(data) {
			$("#areaId_3").empty();
			$("#areaId_3").append( "<option value='0'>请选择..</option>" );
		 	$.each(data, function(i, item) {
	            $("#areaId_3").append( "<option value='" + item.id + "'>" + item.areaName + "</option>" );
	        });
	 });
}

//初始取得第一级区域
//getChildArea1("0");

</script>

<%@ include file="/static/include/bottom.jsp"%>
